package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();


    List<Goods> queryPageGoods(
            @Param("jumpCount") Integer jumpCount
            , @Param("pageSize")Integer pageSize
            , @Param("codeOrName")String codeOrName
            , @Param("goodsTypeId")Integer goodsTypeId);

    Integer queryTotalCount(@Param("codeOrName")String codeOrName
            , @Param("goodsTypeId")Integer goodsTypeId);

    List<Goods> queryPageGoodsByNameAndTypeId(@Param("jumpCount")Integer jumpCount, @Param("pageSize")Integer pageSize,
                                              @Param("goodsName") String goodsName,@Param("goodsTypeId") String goodsTypeId);

    Integer queryTotalCountByNameAndTypeId();

    void save(Goods goods);

    void update(Goods goods);

    Goods queryById(Integer goodsId);

    void deleteById(Integer goodsId);

    List<Goods> queryNoInventoryQuantity(@Param("jumpCount") Integer jumpCount,
                                         @Param("pageSize") Integer pageSize,
                                         @Param("nameOrCode")String nameOrCode);
    List<Goods> queryHasInventoryQuantity(@Param("jumpCount") Integer jumpCount,
                                         @Param("pageSize") Integer pageSize,
                                         @Param("nameOrCode")String nameOrCode);
    Integer queryNoInventoryQuantityTotal(@Param("nameOrCode")String nameOrCode);
    Integer queryHasInventoryQuantityTotal(@Param("nameOrCode")String nameOrCode);

    void saveStockOrQuantityOrPrice(@Param("goodsId")Integer goodsId,
                                    @Param("inventoryQuantity")Integer inventoryQuantity,
                                    @Param("purchasingPrice")double purchasingPrice);

    void deleteStock(Integer goodsId);

    List<Goods> listAlarm();
}
